-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add snapshot to mbuild Compound backmapping method #83
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
After chatting with @StephMcCallum there was some discussion about how to handle cases where two atoms need to be removed to form monomer-monomer bonds during fine-graining. A common example would be removing the -OH group from something like in polyalanine. I suggested we keep the behavior as explicit as possible, so that it only ever removes particles you tell it to. To support removing multiple particles when needed, If we want to be less strict, we could add a check that if the particle given by one of the |
grits/finegrain.py
Outdated
particle.name != "H" | ||
): # removes hydrogen when reacting group is -OH | ||
remove_atoms.append( | ||
[p for p in particle.direct_bonds()][1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be careful here. We should iterate through particle.direct_bonds()
and make sure we are ony removing ones that are hydrogens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that my most recent push addresses this. I added a library parameter as suggested above and adjusted the code so that bond_head_index and bond_tail_index are lists. The user can input a list of indices to remove and the first listed index will be the polymerization bond. Or they can give the library key which I put a few examples but the key points to a nested dictionary.
I removed the code above, but we can add element specific checks if needed. I think it may be better to keep it general at this point and have the user control the removed elements through the list inputs.
…toms. This is working but could be more concise.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Right now,
finegrain.py
has a method that performs back mapping on an mBuild compound. This PR adds a method that performs the back mapping on agsd.hoomd.Frame
(i.e. Snapshot) and returns an mBuild compound.Still a couple of things left to do: